package com.aos.erp.gov.ex.task;

import com.aos.erp.gov.ex.model.GovSchoolTicket;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class SyncExecuteCenterAdapter {
    @Resource
    private List<SyncExecuteCenter> centerList;

    public SyncExecuteCenter matchCenter(GovSchoolTicket ticket) {
        if (centerList != null) {
            for (SyncExecuteCenter center : centerList) {
                if (center.isWebOwner(ticket)) {
                    return center;
                }
            }
        }
        return null;
    }
}
